package com.zzyl.nursing.domain.iot;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@NoArgsConstructor
@Data
public class IotData {


    @JsonProperty("body")
    private BodyDTO body;
    @JsonProperty("header")
    private HeaderDTO header;

    @NoArgsConstructor
    @Data
    public static class BodyDTO {
        @JsonProperty("services")
        private List<ServicesDTO> services;

        @NoArgsConstructor
        @Data
        public static class ServicesDTO {
            @JsonProperty("event_time")
            private String eventTime;
            @JsonProperty("properties")
            private PropertiesDTO properties;
            @JsonProperty("service_id")
            private String serviceId;

            @NoArgsConstructor
            @Data
            public static class PropertiesDTO {
                @JsonProperty("BatteryPercentage")
                private Double batteryPercentage;
                @JsonProperty("BodyTemp")
                private Double bodyTemp;
                @JsonProperty("HeartRate")
                private Double heartRate;
                @JsonProperty("xueyang")
                private Double xueyang;
            }
        }
    }

    @NoArgsConstructor
    @Data
    public static class HeaderDTO {
        @JsonProperty("app_id")
        private String appId;
        @JsonProperty("device_id")
        private String deviceId;
        @JsonProperty("gateway_id")
        private String gatewayId;
        @JsonProperty("node_id")
        private String nodeId;
        @JsonProperty("product_id")
        private String productId;
    }
}
